
import 'dart:convert';
import 'package:ichinesereader/models/student/Assessment.dart';

AssessmentRecordsResult assessmentRecordsResultFromJson(String str) => AssessmentRecordsResult.fromJson(json.decode(str));
String assessmentRecordsResultToJson(AssessmentRecordsResult data) => json.encode(data.toJson());

class AssessmentRecordsResult {
    AssessmentRecordsResult({
        this.limit,
        this.page,
        this.count,
        this.list,
    });

    int? limit;
    int? page;
    int? count;
    List<QuestionRecord>? list;

    factory AssessmentRecordsResult.fromJson(Map<String, dynamic> json) => AssessmentRecordsResult(
        limit: json["limit"],
        page: json["page"],
        count: json["count"],
        list:json["list"]!=null ? List<QuestionRecord>.from(json["list"].map((x) => QuestionRecord.fromJson(x))): null,
    );

    Map<String, dynamic> toJson() => {
        "limit": limit,
        "page": page,
        "count": count,
        "list": List<dynamic>.from(list!.map((x) => x.toJson())),
    };
}

class QuestionRecord {
    QuestionRecord({
      this.mode,
        this.lastName,
        this.submittedTime,
        this.kind,
        this.audioType,
        this.textType,
        this.type,
        this.userName,
        this.firstName,
        this.name,
        this.questionGroup,
        this.id,
        this.questionRecordId,
        this.status,
        this.summaryChange,
        this.completedTime,
        this.summaryLevel,
        this.committedTime,
    });

    
   String? mode;
    String? lastName;
    int? submittedTime;
    String? kind;
    String? audioType;
    String? textType;
    String? type;
    String? userName;
    String? firstName;
    String? name;
    QuestionGroup? questionGroup;
    String? id;
    String? questionRecordId;
    String? status;
    String? summaryChange;
    int? completedTime;
    int? summaryLevel;
    int? committedTime;

    factory QuestionRecord.fromJson(Map<String, dynamic> json) => QuestionRecord(
      mode: json["mode"],
        lastName: json["lastName"],
        submittedTime: json["submittedTime"],
        kind: json["kind"],
        audioType: json["audioType"],
        textType: json["textType"],
        type: json["type"],
        userName: json["userName"],
        firstName: json["firstName"],
        name: json["name"],
        questionGroup:json["questionGroup"]!=null ? QuestionGroup.fromJson(json["questionGroup"]):null,
        id: json["id"],
        questionRecordId: json["questionRecordId"],
        status: json["status"],
        summaryChange: json["summaryChange"] == null ? null : json["summaryChange"],
        completedTime: json["completedTime"] == null ? null : json["completedTime"],
        summaryLevel: json["summaryLevel"] == null ? null : json["summaryLevel"],
        committedTime: json["committedTime"],
    );

    Map<String, dynamic> toJson() => {
      "mode": mode,
        "lastName": lastName,
        "submittedTime": submittedTime,
        "kind": kind,
        "audioType": audioType,
        "textType": textType,
        "type": type,
        "userName": userName,
        "firstName": firstName,
        "name": name,
        "questionGroup": questionGroup?.toJson(),
        "id": id,
        "questionRecordId": questionRecordId,
        "status": status,
        "summaryChange": summaryChange == null ? null : summaryChange,
        "completedTime": completedTime == null ? null : completedTime,
        "summaryLevel": summaryLevel == null ? null : summaryLevel,
         "committedTime": committedTime,
    };
}
